const { DataTypes, Sequelize } = require('sequelize');
const { sequelize } = require('../database');
const { v4: uuidv4 } = require('uuid');

const ComBrand = sequelize.define('com_brand', {
    brandName: {
      type: DataTypes.STRING(64),
      field: 'brand_name',
      comment: "品牌名"
    },

    brandId: {
      type: DataTypes.BIGINT,
      field: 'brand_id',
      primaryKey: true,
      allowNull: false,
      autoIncrement: true,
      comment: "品牌id"
    },

    platform: {
      type: DataTypes.BIGINT,
      field: 'platform',
      comment: "平台（1 1688 2拼多多 3 微信）"
    },

    contact: {
      type: DataTypes.STRING(64),
      field: 'contact',
      comment: "联系人"
    },

    remark: {
      type: DataTypes.STRING(255),
      field: 'remark',
      comment: "备注"
    },

    createtime: {
      type: DataTypes.DATE,
      field: 'createTime'
    }
}, {
  tableName: 'com_brand',
  timestamps: false,
  underscored: true,  // 启用字段映射
  freezeTableName: true  // 固定表名
});

module.exports = ComBrand;